﻿@model IEnumerable<_PLATFORM.DATA.FITTING_TYPE_ASSET>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            SYSTEM
        </th>
        <th>
            FITTING_TYPE_ASSET
        </th>
        <th></th>
    </tr>

    @foreach (var entry in ViewBag.SystemsAndFittingTypeAssets as Dictionary<_PLATFORM.DATA.SYSTEM, List<_PLATFORM.DATA.FITTING_TYPE_ASSET>>)
    { 
        
        <tr>
            <td>
                @{
                    var system = entry.Key as _PLATFORM.DATA.SYSTEM;   
                }
                @system.NAME
            </td>
            <td>
                @{ var systemFittingTypeAssets = entry.Value as List<_PLATFORM.DATA.FITTING_TYPE_ASSET>; }
                <ul>
                @foreach (var sfta in systemFittingTypeAssets) { 
                    <li>
                        @sfta.NAME
                    </li>
                }
                </ul>
            </td>
            <td>
                @Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) |
                @Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |
                @Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })
            </td>
        </tr>
    }

</table>
